<?php
$this->breadcrumbs = array(
	'材料列表' => array(
		'index'
	),
	$model->name => array(
		'view',
		'id' => $model->id
	),
	'更新',
);

$this->userActions = array(
		array(
		'label' => '新建材料',
		'url' => array(
			'create'
		),
		'iconClass' => 'icon-cog-add'
	),
	array(
		'label' => '查看 ' . $model->name,
		'url' => array(
			'view',
			'id' => $model->id
		),
		'iconClass' => 'icon-cog'
	),
	array(
		'label' => '管理材料',
		'url' => array(
			'admin'
		)
	),
);
?>

<h1>更新型号</h1>
<div class="">
<div class="span-4"><?php echo CHtml::encode($model->category->name); ?> &gt; &gt;</div>
<div class="span-2"><?php echo CHtml::encode($model->name);
					?></div>

<div class="clear"></div>
</div>
<div>
<div class="update-items-grid">
<div class="form">
<?php echo CHtml::beginForm(array(
	'updateModels',
	'id' => $model->id
));
?>
<?php
$items = array_slice($model->models, 0);
$items[] = $newItem;

$this
	->widget('zii.widgets.grid.CGridView',
		array(
			'id' => 'material-models-grid',
			'dataProvider' => new CArrayDataProvider($items,
				array(
					'pagination' => false
				)),
			'enablePagination' => false,
			'columns' => array(
				array(
					'header' => '型号',
					'type' => 'raw',
					'value' => 'CHtml::activeTextField($data, "[$row]model",array());',
				),
				array(
					'header' => '清单编号',
					'type' => 'raw',
					'value' => 'CHtml::activeTextField($data, "[$row]code",array());',
				),
				array(
					'header' => '标准单位',
					'type' => 'raw',
					'value' => 'CHtml::activeTextField($data, "[$row]unit",array());',
				),
				array(
					'header' => '配合/台班号',
					'type' => 'raw',
					'value' => 'CHtml::activeTextField($data, "[$row]referenceCode",array());',
				),
				array(
					'header' => '备注',
					'type' => 'raw',
					'value' => 'CHtml::activeTextField($data, "[$row]note",array());',
				),
				array(
					'class' => 'CButtonColumn',
					'template' => '{delete}',
					'deleteButtonUrl' => 'Yii::app()->controller->createUrl("deleteModel",array("id"=>$data->primaryKey))'
				),
			),
		));
?>
<div>“标准单位”必须使用具体的单位名称如“米”、“平方米”、“立方米”、“升”、“千克”、“吨”、“颗”等。<br />
勿使用含糊的单位如“盒”、“桶”、“根”、“张”、“把”、“卷”、“车”等。</div>
<?php echo CHtml::submitButton('添加/保存'); ?>
<?php echo CHtml::endForm(); ?>
</div><!-- form -->
</div>
</div>
